package com.jiyun.controller;


import com.jiyun.Vo.HomeVo;
import com.jiyun.pojo.Home;
import com.jiyun.pojo.Result;
import com.jiyun.service.IHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-12-17
 */
@RestController
@RequestMapping("/api/home")
public class HomeController {

    @Autowired
    private IHomeService homeService;

    @PostMapping("homeshow")
    public Result homeshow(){
        List<Home> list = homeService.list();
        return Result.success(list);
    }

    @PostMapping("homeshowlist")
    public Result homeshowlist(Home home){
        List<HomeVo> list = homeService.homeshowlist(home);
        return Result.success(list);
    }

}
